import { RouteRecordRaw } from 'vue-router'
import TopNav from '../components/TopNav.vue'
import Article from '../pages/base/Article.vue'
import Source from '../pages/base/Source.vue'

const routes: RouteRecordRaw[] = [
  {
    path: '/',
    redirect: '/index',
  },
  {
    path: '/index',
    name: 'index',
    redirect: '/index/article',
    components: {
      nav: TopNav,
      default: () => import('../pages/base/Index.vue'),
    },
    children: [
      {
        path: 'article',
        name: 'indexArticle',
        component: () =>
          import('../pages/base/components/index/IndexArticle.vue'),
      },
      {
        path: 'source',
        name: 'indexSource',
        component: () =>
          import('../pages/base/components/index/IndexSource.vue'),
      },
    ],
  },
  {
    path: '/test',
    name: 'test',
    component: () => import('@/pages/test/Index.vue'),
  },
]

export default routes
